import React, {FC} from 'react';
import "./index.less";
import "../../index.less";
import SearchArticle from "@/pages/SearchPage/SearchArticle";
import usePgSearch from "@/pages/SearchPage/common/usePgSearch";
import {useParams} from "umi";
import {useRequest} from "ahooks";
import * as API from "@/services";

interface AdvSearchArticleProps {
}

const AdvSearchArticle: FC<AdvSearchArticleProps> = (props) => {
  const {specialColumnId} = useParams();
  const {currentSearch} = usePgSearch();

  const specialColumnReq = useRequest(() => API.queryFrontJournalSpecialColumn(specialColumnId!), {
    refreshDeps: [specialColumnId],
    ready: !!specialColumnId
  });

  const specialColumn= specialColumnReq.data?.data;

  return (
    <div className={"adv-search-article-container adv-search-special-column-article-container"}>
      <div className={"search-special-column-container"}>
        <h3 className={"search-special-column-title"}>{specialColumn?.name}</h3>
        <div className={"search-special-column-intro"}>{specialColumn?.introduction}</div>
      </div>
      <SearchArticle
        additionalQuery={{
          specialColumnIds: specialColumnId
        }}
      />
    </div>
  );
};

export default AdvSearchArticle;
